home *** CD-ROM | disk | FTP | other *** search
- #include "generic window handlers.h"
- #include "program globals.h"
- #include "text layer.h"
- #if USE_DRAG
- #include "drag layer.h"
- #endif
- #include "window layer.h"
- #include "key layer.h"
- #include "main.h"
-
- #if USE_STYLED_TEXT
- #include "styled text layer.h"
- #endif
-
- #define kGrowBoxSize 15
-
- extern Boolean gInProgress; /* see environment.h */
- extern Boolean gCustomCursor;
-
- void GenericCopybits(WindowRef theWindow, WindowRef offscreenWindowRef, Boolean active,
- Boolean drawGrowIconLines)
- {
- Rect tempRect;
-
- if (active)
- {
- DrawGrowIconNoLines(theWindow, drawGrowIconLines);
- }
- else
- {
- tempRect.bottom=theWindow->portRect.bottom;
- tempRect.right=theWindow->portRect.right;
- tempRect.left=tempRect.right-kGrowBoxSize+1;
- tempRect.top=tempRect.bottom-kGrowBoxSize+1;
- EraseRect(&tempRect);
- }
-
- UpdateControls(theWindow, theWindow->visRgn);
-
- tempRect=theWindow->portRect;
- tempRect.bottom-=kGrowBoxSize;
- tempRect.right-=kGrowBoxSize;
- CopyBits( &(offscreenWindowRef->portBits),
- &(theWindow->portBits),
- &tempRect, &tempRect, 0, 0L);
- }
-
- void GenericResizeControls(WindowRef theWindow, short destOverload, short headerHeight,
- Boolean isStyled)
- {
- #if !USE_STYLED_TEXT
- #pragma unused(isStyled)
- #endif
-
- TEHandle hTE;
- ControlHandle vScrollBar, hScrollBar;
-
- hTE=GetWindowTE(theWindow);
- vScrollBar=GetWindowVScrollBar(theWindow);
- hScrollBar=GetWindowHScrollBar(theWindow);
- AdjustScrollSizes(theWindow, hTE, vScrollBar, hScrollBar, destOverload, headerHeight);
- #if USE_STYLED_TEXT
- if (!isStyled)
- #endif
- AdjustViewRect(hTE);
- TECalText(hTE);
- #if USE_STYLED_TEXT
- if (isStyled)
- {
- StyledAdjustForEndScroll(vScrollBar, hTE);
- StyledAdjustVScrollBar(vScrollBar, hTE);
- }
- else
- {
- #endif
- AdjustForEndScroll(vScrollBar, hTE);
- AdjustVScrollBar(vScrollBar, hTE);
- #if USE_STYLED_TEXT
- }
- #endif
- #if USE_DRAG
- ResetHiliteRgn(theWindow);
- #endif
- }
-
- void GenericGetGrowSize(Rect *sizeRect)
- {
- SetRect(sizeRect, 200, 48+kGrowBoxSize+1, 32766, 32767);
- }
-
- void GenericIdleInWindow(WindowRef theWindow, Point mouseLoc)
- {
- TEHandle